{% extends 'layout.html'%}

{%block content%}
{%for content in contents%}
<div class="listbox" style="height: auto">
    <h1>{{content.title}}</h1>
    <p class="CDefault">
        作者：<span class="cInfo">{{content.user.username}}</span>
        时间：<span class="cInfo">{{content.addTime|date('Y年m月d日h:i:s',-8*60)}}</span>
        阅读：<span class="cInfo">{{content.views}}</span>
        评论：<span class="cInfo">{{content.comments.length}}</span>
    </p>
    <i><p>{{content.description}}</p></i>
    <div class="function"><a href="/view?contentid={{content.id}}">阅读全文</a></div>
</div>
<div class="footer">
    <ul>
        <li class="prev">
            {%if page<=1%}
            <span>没有上一页了</span>
            {%else%}
            <a href="/?category={{category}}&page={{page-1}}">上一页</a>
            {%endif%}

        </li>
        {%if pages>0%}
        <li class="middle">
            <strong>{{page}}/{{pages}}</strong>
        </li>
        {%endif%}
        <li class="next">
            {%if page>=pages%}
            <span>没有下一页了</span>
            {%else%}
            <a href="/?category={{category}}&page={{page+1}}">下一页</a>
            {%endif%}
        </li>
    </ul>
</div>
{%endfor%}
{%endblock%}